home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-3139 / stadconv / read.me < prev    next >
Text File  |  1987-04-21  |  4KB  |  96 lines

  1. Hello ppl,
  2.  
  3. Here is a small ass-routine to decode packed STAD-pictures to 32k-
  4. (screenformat) pictures and to encode 32k-pictures to STAD-pics.
  5. Some remarks to STAD:
  6. STAD till version 1.2+ doesn't pack the pictures in the best way. Such
  7. stored pictures will shrink (10-1000 Bytes) by encoding and later decoding
  8. with my routine. The new files are absolutly compatible to the old ones
  9. (the old Stad-Versions <=1.2+ could read them too!).
  10. STAD 1.3+ doesn't make this "error" anymore, but sometimes there is an
  11. error in the 2nd Byte of the compressed pictures (to see in the 2nd line
  12. of the pictures to the left)
  13. Since i don't use STAD, I will be glad to get some more hints/infos.
  14. (adress is at the end of this doc)
  15.  
  16.  
  17. Decode STAD-pictures:
  18. =====================
  19. The routine assumes, that the packed STAD-pic is already in memory. You
  20. have to specify a destination-adress to write the uncompressed picture to
  21. (32000 Bytes length) - e.g. the screen-adress. Both adresses are passed
  22. via the stack to the routine. A return code is in the register D0. A zero
  23. means "everything ok", a 1 means "this is not a packed STAD-picture".
  24. The error 1 can in some very special (in fact only constructed) cases
  25. occure on STAD-pictures: The compression-algorith used by STAD "compresses"
  26. the picture in the worst case to a 32507 Bytes length picture. STAD
  27. recognizes this of course and stores the 32k picture "as is" (not packed).
  28. In such a case it is clearly that you cann't unpack the picture.....
  29. The decode-algorith takes about 0.2 - 0.3 sec. to decode a STAD-picture.
  30.  
  31.   Example (in GfA-Basic)
  32.  
  33.     DIM buffer|(32000)
  34.     INLINE fromstad%,254
  35.     BLOAD "A:\TEST.PAC",V:buffer|(1)
  36.     IF C:fromstad%(L:V:buffer|(1),L:XBIOS(2))=1
  37.       PRINT "Fehler: kein gepacktes STAD-Format"
  38.     ENDIF
  39.  
  40. (Cursor on the "INLINE"-command, press HELP-Taste, select LOAD and load the
  41.  file "FROMSTAD.INL")
  42.  
  43. ...it should also be possible to call the routine by other languages. The
  44. routine returns by an RTS and leaves both 32-Bit-Values at the stack (a la
  45. TRAP..). The routine needs following:
  46.  
  47.         (sp)  returnadress for RTS
  48.        4(sp)  adress of the packed STAD-Bildes
  49.        8(sp)  adress of the destination-buffer (Length 32000 Bytes)
  50. (Odd adresses are allowed.)
  51.  
  52.  
  53.  
  54. Packing 32k-Pictures:
  55. =====================
  56. The routine assumes, that the original 32k-pic is already in memory (e.g.
  57. in the screen-memory). The routine needs a buffer of 32507 Bytes (see the
  58. section "decode" for details). If the packed picture is greater than 32000
  59. Bytes then the original picture is copied to the buffer. The return value
  60. in register D0 is the length of the compressed picture - if the length is
  61. 32000 then the picture is not compressed, but copied.
  62. The pack-routine takes about 0.9 - 1.3 sec.
  63.  
  64.   Example (in GfA-Basic)
  65.  
  66.     DIM buffer|(32000)
  67.     INLINE tostad%,676
  68.     laenge%=C:tostad%(L:XBIOS(2),L:V:buffer|(1))
  69.     BSAVE "A:\TEST.PAC",L:V:buffer|(1),laenge%
  70.  
  71. (load inline, see above)
  72. Other calls (see also explanation in the "decode"-section): Stack-Belegung:
  73.         (sp)  returen adress for RTS
  74.        4(sp)  adress of the unpacked 32k-pic
  75.        8(sp)  buffer (destination) of the packed STAD-Pic. 
  76.                 (Length min.32507 Bytes)
  77.  
  78.  
  79.  
  80.  
  81. By the way...
  82.  
  83. This package is public-domain. Everyone may (and should) it copy, use
  84. and give it to friends. The distribution is only allowed as COMPLETE(!)
  85. package (include ALL files - also both DOC-Versions).
  86. If someone is corrects or changes anything on this programm I would be
  87. glad if he/she drops me a note (and perhaps sends me the new version).
  88.  
  89.  
  90.        Wolfgang Ley                       e-mail to:
  91.        Teichstraße 9            or            BWWL@DCZTU1.BITNET
  92. W-3392 Clausthal-Zellerfeld                   BWWL@ibm.rz.tu-clausthal.de
  93.        (Germany)
  94.        Phone: Germany - 05323/82132
  95.  
  96.